# Copyright (c) 2009 IW.
# All rights reserved.
#
# Author: liuguiyang <liuguiyangnwpu@gmail.com>
# Date:   2017/10/17

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from matplotlib import pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D


res_details_dict = dict(airplane=[[0.0, 0.0, 0.6675977653631285, 1.0],
                                  [0.0, 0.125, 0.9446640316205533, 1.0],
                                  [0.0, 0.25, 0.9558232931726908, 0.99581589958159],
                                  [0.0, 0.375, 0.9635627530364372, 0.99581589958159],
                                  [0.0, 0.5, 0.963265306122449, 0.9874476987447699],
                                  [0.0, 0.625, 0.9628099173553719, 0.9748953974895398],
                                  [0.0, 0.75, 0.9699570815450643, 0.9699570815450643],
                                  [0.0, 0.875, 1.0, 0.3817204301075269],
                                  [0.0, 1.0, 0, 0],
                                  [0.125, 0.0, 0.6675977653631285, 1.0],
                                  [0.125, 0.125, 0.9446640316205533, 1.0],
                                  [0.125, 0.25, 0.9558232931726908, 0.99581589958159],
                                  [0.125, 0.375, 0.9635627530364372, 0.99581589958159],
                                  [0.125, 0.5, 0.963265306122449, 0.9874476987447699],
                                  [0.125, 0.625, 0.9628099173553719, 0.9748953974895398],
                                  [0.125, 0.75, 0.9699570815450643, 0.9699570815450643],
                                  [0.125, 0.875, 1.0, 0.3817204301075269],
                                  [0.125, 1.0, 0, 0],
                                  [0.25, 0.0, 0.6675977653631285, 1.0],
                                  [0.25, 0.125, 0.9446640316205533, 1.0],
                                  [0.25, 0.25, 0.9558232931726908, 0.99581589958159],
                                  [0.25, 0.375, 0.9635627530364372, 0.99581589958159],
                                  [0.25, 0.5, 0.963265306122449, 0.9874476987447699],
                                  [0.25, 0.625, 0.9628099173553719, 0.9748953974895398],
                                  [0.25, 0.75, 0.9699570815450643, 0.9699570815450643],
                                  [0.25, 0.875, 1.0, 0.3817204301075269],
                                  [0.25, 1.0, 0, 0],
                                  [0.375, 0.0, 0.6675977653631285, 1.0],
                                  [0.375, 0.125, 0.9446640316205533, 1.0],
                                  [0.375, 0.25, 0.9558232931726908, 0.99581589958159],
                                  [0.375, 0.375, 0.9635627530364372, 0.99581589958159],
                                  [0.375, 0.5, 0.963265306122449, 0.9874476987447699],
                                  [0.375, 0.625, 0.9628099173553719, 0.9748953974895398],
                                  [0.375, 0.75, 0.9699570815450643, 0.9699570815450643],
                                  [0.375, 0.875, 1.0, 0.3817204301075269],
                                  [0.375, 1.0, 0, 0],
                                  [0.5, 0.0, 0.6675977653631285, 1.0],
                                  [0.5, 0.125, 0.9446640316205533, 1.0],
                                  [0.5, 0.25, 0.9558232931726908, 0.99581589958159],
                                  [0.5, 0.375, 0.9635627530364372, 0.99581589958159],
                                  [0.5, 0.5, 0.963265306122449, 0.9874476987447699],
                                  [0.5, 0.625, 0.9628099173553719, 0.9748953974895398],
                                  [0.5, 0.75, 0.9699570815450643, 0.9699570815450643],
                                  [0.5, 0.875, 1.0, 0.3817204301075269],
                                  [0.5, 1.0, 0, 0],
                                  [0.625, 0.0, 0.6620111731843575, 0.9916317991631799],
                                  [0.625, 0.125, 0.9367588932806324, 0.9916317991631799],
                                  [0.625, 0.25, 0.9477911646586346, 0.9874476987447699],
                                  [0.625, 0.375, 0.9554655870445344, 0.9874476987447699],
                                  [0.625, 0.5, 0.9551020408163265, 0.9790794979079498],
                                  [0.625, 0.625, 0.9545454545454546, 0.9665271966527197],
                                  [0.625, 0.75, 0.9613733905579399, 0.9613733905579399],
                                  [0.625, 0.875, 1.0, 0.3817204301075269],
                                  [0.625, 1.0, 0, 0],
                                  [0.75, 0.0, 0.5949720670391061, 0.891213389121339],
                                  [0.75, 0.125, 0.841897233201581, 0.891213389121339],
                                  [0.75, 0.25, 0.8514056224899599, 0.8870292887029289],
                                  [0.75, 0.375, 0.8582995951417004, 0.8870292887029289],
                                  [0.75, 0.5, 0.8571428571428571, 0.8786610878661087],
                                  [0.75, 0.625, 0.859504132231405, 0.8702928870292888],
                                  [0.75, 0.75, 0.8669527896995708, 0.8669527896995708],
                                  [0.75, 0.875, 0.971830985915493, 0.3709677419354839],
                                  [0.75, 1.0, 0, 0],
                                  [0.875, 0.0, 0.2681564245810056, 0.401673640167364],
                                  [0.875, 0.125, 0.3794466403162055, 0.401673640167364],
                                  [0.875, 0.25, 0.3855421686746988, 0.401673640167364],
                                  [0.875, 0.375, 0.38866396761133604, 0.401673640167364],
                                  [0.875, 0.5, 0.39183673469387753, 0.401673640167364],
                                  [0.875, 0.625, 0.3925619834710744, 0.39748953974895396],
                                  [0.875, 0.75, 0.4034334763948498, 0.4034334763948498],
                                  [0.875, 0.875, 0.5915492957746479, 0.22580645161290322],
                                  [0.875, 1.0, 0, 0],
                                  [1.0, 0.0, 0, 0],
                                  [1.0, 0.125, 0, 0],
                                  [1.0, 0.25, 0, 0],
                                  [1.0, 0.375, 0, 0],
                                  [1.0, 0.5, 0, 0],
                                  [1.0, 0.625, 0, 0],
                                  [1.0, 0.75, 0, 0],
                                  [1.0, 0.875, 0, 0],
                                  [1.0, 1.0, 0, 0]],
                        ship=[[0.0, 0.0, 0.6, 0.9884393063583815],
                              [0.0, 0.125, 0.9254658385093167, 0.9612903225806452],
                              [0.0, 0.25, 0.9407894736842105, 0.934640522875817],
                              [0.0, 0.375, 0.958904109589041, 0.9333333333333333],
                              [0.0, 0.5, 0.9712230215827338, 0.9440559440559441],
                              [0.0, 0.625, 0.9701492537313433, 0.9154929577464789],
                              [0.0, 0.75, 1.0, 0.8014705882352942],
                              [0.0, 0.875, 1.0, 0.1875],
                              [0.0, 1.0, 0, 0],
                              [0.125, 0.0, 0.5473684210526316, 0.9017341040462428],
                              [0.125, 0.125, 0.8944099378881988, 0.9290322580645162],
                              [0.125, 0.25, 0.9144736842105263, 0.9084967320261438],
                              [0.125, 0.375, 0.9315068493150684, 0.9066666666666666],
                              [0.125, 0.5, 0.9568345323741008, 0.9300699300699301],
                              [0.125, 0.625, 0.9626865671641791, 0.9084507042253521],
                              [0.125, 0.75, 0.9724770642201835, 0.7794117647058824],
                              [0.125, 0.875, 1.0, 0.1875],
                              [0.125, 1.0, 0, 0],
                              [0.25, 0.0, 0.543859649122807, 0.8959537572254336],
                              [0.25, 0.125, 0.8944099378881988, 0.9290322580645162],
                              [0.25, 0.25, 0.9144736842105263, 0.9084967320261438],
                              [0.25, 0.375, 0.9315068493150684, 0.9066666666666666],
                              [0.25, 0.5, 0.9568345323741008, 0.9300699300699301],
                              [0.25, 0.625, 0.9626865671641791, 0.9084507042253521],
                              [0.25, 0.75, 0.9724770642201835, 0.7794117647058824],
                              [0.25, 0.875, 1.0, 0.1875],
                              [0.25, 1.0, 0, 0], [0.375, 0.0, 0.5403508771929825, 0.8901734104046243],
                              [0.375, 0.125, 0.8881987577639752, 0.9225806451612903],
                              [0.375, 0.25, 0.9078947368421053, 0.9019607843137255],
                              [0.375, 0.375, 0.9315068493150684, 0.9066666666666666],
                              [0.375, 0.5, 0.9568345323741008, 0.9300699300699301],
                              [0.375, 0.625, 0.9626865671641791, 0.9084507042253521],
                              [0.375, 0.75, 0.9724770642201835, 0.7794117647058824],
                              [0.375, 0.875, 1.0, 0.1875],
                              [0.375, 1.0, 0, 0],
                              [0.5, 0.0, 0.5157894736842106, 0.8497109826589595],
                              [0.5, 0.125, 0.8757763975155279, 0.9096774193548387],
                              [0.5, 0.25, 0.8947368421052632, 0.8888888888888888],
                              [0.5, 0.375, 0.9178082191780822, 0.8933333333333333],
                              [0.5, 0.5, 0.9424460431654677, 0.916083916083916],
                              [0.5, 0.625, 0.9552238805970149, 0.9014084507042254],
                              [0.5, 0.75, 0.963302752293578, 0.7720588235294118],
                              [0.5, 0.875, 1.0, 0.1875],
                              [0.5, 1.0, 0, 0],
                              [0.625, 0.0, 0.47368421052631576, 0.7803468208092486],
                              [0.625, 0.125, 0.8074534161490683, 0.8387096774193549],
                              [0.625, 0.25, 0.8289473684210527, 0.8235294117647058],
                              [0.625, 0.375, 0.8561643835616438, 0.8333333333333334],
                              [0.625, 0.5, 0.8776978417266187, 0.8531468531468531],
                              [0.625, 0.625, 0.8955223880597015, 0.8450704225352113],
                              [0.625, 0.75, 0.908256880733945, 0.7279411764705882],
                              [0.625, 0.875, 1.0, 0.1875],
                              [0.625, 1.0, 0, 0],
                              [0.75, 0.0, 0.40350877192982454, 0.6647398843930635],
                              [0.75, 0.125, 0.7080745341614907, 0.7354838709677419],
                              [0.75, 0.25, 0.743421052631579, 0.738562091503268],
                              [0.75, 0.375, 0.7671232876712328, 0.7466666666666667],
                              [0.75, 0.5, 0.7913669064748201, 0.7692307692307693],
                              [0.75, 0.625, 0.8134328358208955, 0.7676056338028169],
                              [0.75, 0.75, 0.8440366972477065, 0.6764705882352942],
                              [0.75, 0.875, 1.0, 0.1875],
                              [0.75, 1.0, 0, 0],
                              [0.875, 0.0, 0.14736842105263157, 0.24277456647398843],
                              [0.875, 0.125, 0.2608695652173913, 0.2709677419354839],
                              [0.875, 0.25, 0.27631578947368424, 0.27450980392156865],
                              [0.875, 0.375, 0.2876712328767123, 0.28],
                              [0.875, 0.5, 0.302158273381295, 0.2937062937062937],
                              [0.875, 0.625, 0.30597014925373134, 0.2887323943661972],
                              [0.875, 0.75, 0.3211009174311927, 0.25735294117647056],
                              [0.875, 0.875, 0, 0],
                              [0.875, 1.0, 0, 0],
                              [1.0, 0.0, 0, 0],
                              [1.0, 0.125, 0, 0],
                              [1.0, 0.25, 0, 0],
                              [1.0, 0.375, 0, 0],
                              [1.0, 0.5, 0, 0],
                              [1.0, 0.625, 0, 0],
                              [1.0, 0.75, 0, 0],
                              [1.0, 0.875, 0, 0],
                              [1.0, 1.0, 0, 0]],
                        storagetank=[[0.0, 0.0, 0.7255985267034991, 0.9949494949494949],
                                     [0.0, 0.125, 0.9475, 0.9570707070707071],
                                     [0.0, 0.25, 0.9664082687338501, 0.9444444444444444],
                                     [0.0, 0.375, 0.9838709677419355, 0.9242424242424242],
                                     [0.0, 0.5, 0.9971910112359551, 0.8964646464646465],
                                     [0.0, 0.625, 1.0, 0.8181818181818182],
                                     [0.0, 0.75, 1.0, 0.42209631728045327],
                                     [0.0, 0.875, 1.0, 0.07142857142857142],
                                     [0.0, 1.0, 0, 0],
                                     [0.125, 0.0, 0.7053406998158379, 0.9671717171717171],
                                     [0.125, 0.125, 0.94, 0.9494949494949495],
                                     [0.125, 0.25, 0.9638242894056848, 0.9419191919191919],
                                     [0.125, 0.375, 0.9811827956989247, 0.9217171717171717],
                                     [0.125, 0.5, 0.9943820224719101, 0.8939393939393939],
                                     [0.125, 0.625, 0.9969135802469136, 0.8156565656565656],
                                     [0.125, 0.75, 1.0, 0.42209631728045327],
                                     [0.125, 0.875, 1.0, 0.07142857142857142],
                                     [0.125, 1.0, 0, 0],
                                     [0.25, 0.0, 0.6961325966850829, 0.9545454545454546],
                                     [0.25, 0.125, 0.94, 0.9494949494949495],
                                     [0.25, 0.25, 0.9638242894056848, 0.9419191919191919],
                                     [0.25, 0.375, 0.9811827956989247, 0.9217171717171717],
                                     [0.25, 0.5, 0.9943820224719101, 0.8939393939393939],
                                     [0.25, 0.625, 0.9969135802469136, 0.8156565656565656],
                                     [0.25, 0.75, 1.0, 0.42209631728045327],
                                     [0.25, 0.875, 1.0, 0.07142857142857142],
                                     [0.25, 1.0, 0, 0],
                                     [0.375, 0.0, 0.6869244935543278, 0.9419191919191919],
                                     [0.375, 0.125, 0.9275, 0.9368686868686869],
                                     [0.375, 0.25, 0.9509043927648578, 0.9292929292929293],
                                     [0.375, 0.375, 0.9731182795698925, 0.9141414141414141],
                                     [0.375, 0.5, 0.9943820224719101, 0.8939393939393939],
                                     [0.375, 0.625, 0.9969135802469136, 0.8156565656565656],
                                     [0.375, 0.75, 1.0, 0.42209631728045327],
                                     [0.375, 0.875, 1.0, 0.07142857142857142],
                                     [0.375, 1.0, 0, 0],
                                     [0.5, 0.0, 0.6758747697974218, 0.9267676767676768],
                                     [0.5, 0.125, 0.9075, 0.9166666666666666],
                                     [0.5, 0.25, 0.9302325581395349, 0.9090909090909091],
                                     [0.5, 0.375, 0.9623655913978495, 0.9040404040404041],
                                     [0.5, 0.5, 0.9915730337078652, 0.8914141414141414],
                                     [0.5, 0.625, 0.9969135802469136, 0.8156565656565656],
                                     [0.5, 0.75, 1.0, 0.42209631728045327],
                                     [0.5, 0.875, 1.0, 0.07142857142857142],
                                     [0.5, 1.0, 0, 0],
                                     [0.625, 0.0, 0.6353591160220995, 0.8712121212121212],
                                     [0.625, 0.125, 0.8575, 0.8661616161616161],
                                     [0.625, 0.25, 0.8811369509043928, 0.8611111111111112],
                                     [0.625, 0.375, 0.9166666666666666, 0.8611111111111112],
                                     [0.625, 0.5, 0.952247191011236, 0.8560606060606061],
                                     [0.625, 0.625, 0.9660493827160493, 0.7904040404040404],
                                     [0.625, 0.75, 1.0, 0.42209631728045327],
                                     [0.625, 0.875, 1.0, 0.07142857142857142],
                                     [0.625, 1.0, 0, 0],
                                     [0.75, 0.0, 0.4990791896869245, 0.6843434343434344],
                                     [0.75, 0.125, 0.675, 0.6818181818181818],
                                     [0.75, 0.25, 0.6976744186046512, 0.6818181818181818],
                                     [0.75, 0.375, 0.7258064516129032, 0.6818181818181818],
                                     [0.75, 0.5, 0.7584269662921348, 0.6818181818181818],
                                     [0.75, 0.625, 0.7839506172839507, 0.6414141414141414],
                                     [0.75, 0.75, 0.8523489932885906, 0.3597733711048159],
                                     [0.75, 0.875, 1.0, 0.07142857142857142],
                                     [0.75, 1.0, 0, 0],
                                     [0.875, 0.0, 0.17495395948434622, 0.2398989898989899],
                                     [0.875, 0.125, 0.235, 0.23737373737373738],
                                     [0.875, 0.25, 0.24289405684754523, 0.23737373737373738],
                                     [0.875, 0.375, 0.25268817204301075, 0.23737373737373738],
                                     [0.875, 0.5, 0.2640449438202247, 0.23737373737373738],
                                     [0.875, 0.625, 0.2839506172839506, 0.23232323232323232],
                                     [0.875, 0.75, 0.3221476510067114, 0.1359773371104816],
                                     [0.875, 0.875, 0, 0],
                                     [0.875, 1.0, 0, 0],
                                     [1.0, 0.0, 0, 0],
                                     [1.0, 0.125, 0, 0],
                                     [1.0, 0.25, 0, 0],
                                     [1.0, 0.375, 0, 0],
                                     [1.0, 0.5, 0, 0],
                                     [1.0, 0.625, 0, 0],
                                     [1.0, 0.75, 0, 0],
                                     [1.0, 0.875, 0, 0],
                                     [1.0, 1.0, 0, 0]],
                        baseballdiamond=[[0.0, 0.0, 0.6688311688311688, 1.0],
                                         [0.0, 0.125, 0.9074889867841409, 1.0],
                                         [0.0, 0.25, 0.9144144144144144, 0.9950980392156863],
                                         [0.0, 0.375, 0.918552036199095, 0.9950980392156863],
                                         [0.0, 0.5, 0.926605504587156, 0.9901960784313726],
                                         [0.0, 0.625, 0.9305555555555556, 0.9852941176470589],
                                         [0.0, 0.75, 0.9386792452830188, 0.9754901960784313],
                                         [0.0, 0.875, 0.9659090909090909, 0.9042553191489362],
                                         [0.0, 1.0, 0, 0],
                                         [0.125, 0.0, 0.6688311688311688, 1.0],
                                         [0.125, 0.125, 0.9074889867841409, 1.0],
                                         [0.125, 0.25, 0.9144144144144144, 0.9950980392156863],
                                         [0.125, 0.375, 0.918552036199095, 0.9950980392156863],
                                         [0.125, 0.5, 0.926605504587156, 0.9901960784313726],
                                         [0.125, 0.625, 0.9305555555555556, 0.9852941176470589],
                                         [0.125, 0.75, 0.9386792452830188, 0.9754901960784313],
                                         [0.125, 0.875, 0.9659090909090909, 0.9042553191489362],
                                         [0.125, 1.0, 0, 0],
                                         [0.25, 0.0, 0.6688311688311688, 1.0],
                                         [0.25, 0.125, 0.9074889867841409, 1.0],
                                         [0.25, 0.25, 0.9144144144144144, 0.9950980392156863],
                                         [0.25, 0.375, 0.918552036199095, 0.9950980392156863],
                                         [0.25, 0.5, 0.926605504587156, 0.9901960784313726],
                                         [0.25, 0.625, 0.9305555555555556, 0.9852941176470589],
                                         [0.25, 0.75, 0.9386792452830188, 0.9754901960784313],
                                         [0.25, 0.875, 0.9659090909090909, 0.9042553191489362],
                                         [0.25, 1.0, 0, 0],
                                         [0.375, 0.0, 0.6688311688311688, 1.0],
                                         [0.375, 0.125, 0.9074889867841409, 1.0],
                                         [0.375, 0.25, 0.9144144144144144, 0.9950980392156863],
                                         [0.375, 0.375, 0.918552036199095, 0.9950980392156863],
                                         [0.375, 0.5, 0.926605504587156, 0.9901960784313726],
                                         [0.375, 0.625, 0.9305555555555556, 0.9852941176470589],
                                         [0.375, 0.75, 0.9386792452830188, 0.9754901960784313],
                                         [0.375, 0.875, 0.9659090909090909, 0.9042553191489362],
                                         [0.375, 1.0, 0, 0],
                                         [0.5, 0.0, 0.6688311688311688, 1.0],
                                         [0.5, 0.125, 0.9074889867841409, 1.0],
                                         [0.5, 0.25, 0.9144144144144144, 0.9950980392156863],
                                         [0.5, 0.375, 0.918552036199095, 0.9950980392156863],
                                         [0.5, 0.5, 0.926605504587156, 0.9901960784313726],
                                         [0.5, 0.625, 0.9305555555555556, 0.9852941176470589],
                                         [0.5, 0.75, 0.9386792452830188, 0.9754901960784313],
                                         [0.5, 0.875, 0.9659090909090909, 0.9042553191489362],
                                         [0.5, 1.0, 0, 0],
                                         [0.625, 0.0, 0.6688311688311688, 1.0],
                                         [0.625, 0.125, 0.9074889867841409, 1.0],
                                         [0.625, 0.25, 0.9144144144144144, 0.9950980392156863],
                                         [0.625, 0.375, 0.918552036199095, 0.9950980392156863],
                                         [0.625, 0.5, 0.926605504587156, 0.9901960784313726],
                                         [0.625, 0.625, 0.9305555555555556, 0.9852941176470589],
                                         [0.625, 0.75, 0.9386792452830188, 0.9754901960784313],
                                         [0.625, 0.875, 0.9659090909090909, 0.9042553191489362],
                                         [0.625, 1.0, 0, 0],
                                         [0.75, 0.0, 0.6461038961038961, 0.9660194174757282],
                                         [0.75, 0.125, 0.8766519823788547, 0.9660194174757282],
                                         [0.75, 0.25, 0.8918918918918919, 0.9705882352941176],
                                         [0.75, 0.375, 0.8959276018099548, 0.9705882352941176],
                                         [0.75, 0.5, 0.9036697247706422, 0.9656862745098039],
                                         [0.75, 0.625, 0.9074074074074074, 0.9607843137254902],
                                         [0.75, 0.75, 0.9198113207547169, 0.9558823529411765],
                                         [0.75, 0.875, 0.9488636363636364, 0.8882978723404256],
                                         [0.75, 1.0, 0, 0],
                                         [0.875, 0.0, 0.41233766233766234, 0.616504854368932],
                                         [0.875, 0.125, 0.5594713656387665, 0.616504854368932],
                                         [0.875, 0.25, 0.5675675675675675, 0.6176470588235294],
                                         [0.875, 0.375, 0.5701357466063348, 0.6176470588235294],
                                         [0.875, 0.5, 0.573394495412844, 0.6127450980392157],
                                         [0.875, 0.625, 0.5740740740740741, 0.6078431372549019],
                                         [0.875, 0.75, 0.5801886792452831, 0.6029411764705882],
                                         [0.875, 0.875, 0.6420454545454546, 0.601063829787234],
                                         [0.875, 1.0, 0, 0],
                                         [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0],
                                         [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0],
                                         [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0],
                                         [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0],
                                         [1.0, 1.0, 0, 0]],
                        tenniscourt=[[0.0, 0.0, 0.6579572446555819, 0.9892857142857143],
                                     [0.0, 0.125, 0.9081632653061225, 0.9535714285714286],
                                     [0.0, 0.25, 0.9228070175438596, 0.9598540145985401],
                                     [0.0, 0.375, 0.940959409594096, 0.9306569343065694],
                                     [0.0, 0.5, 0.9541984732824428, 0.9124087591240876],
                                     [0.0, 0.625, 0.9672131147540983, 0.8939393939393939],
                                     [0.0, 0.75, 0.973568281938326, 0.85], [0.0, 0.875, 1.0, 0.6342592592592593],
                                     [0.0, 1.0, 0, 0], [0.125, 0.0, 0.6508313539192399, 0.9785714285714285],
                                     [0.125, 0.125, 0.9047619047619048, 0.95],
                                     [0.125, 0.25, 0.9192982456140351, 0.9562043795620438],
                                     [0.125, 0.375, 0.933579335793358, 0.9233576642335767],
                                     [0.125, 0.5, 0.950381679389313, 0.9087591240875912],
                                     [0.125, 0.625, 0.9672131147540983, 0.8939393939393939],
                                     [0.125, 0.75, 0.973568281938326, 0.85], [0.125, 0.875, 1.0, 0.6342592592592593],
                                     [0.125, 1.0, 0, 0], [0.25, 0.0, 0.6508313539192399, 0.9785714285714285],
                                     [0.25, 0.125, 0.9047619047619048, 0.95],
                                     [0.25, 0.25, 0.9192982456140351, 0.9562043795620438],
                                     [0.25, 0.375, 0.933579335793358, 0.9233576642335767],
                                     [0.25, 0.5, 0.950381679389313, 0.9087591240875912],
                                     [0.25, 0.625, 0.9672131147540983, 0.8939393939393939],
                                     [0.25, 0.75, 0.973568281938326, 0.85], [0.25, 0.875, 1.0, 0.6342592592592593],
                                     [0.25, 1.0, 0, 0], [0.375, 0.0, 0.6508313539192399, 0.9785714285714285],
                                     [0.375, 0.125, 0.9047619047619048, 0.95],
                                     [0.375, 0.25, 0.9192982456140351, 0.9562043795620438],
                                     [0.375, 0.375, 0.933579335793358, 0.9233576642335767],
                                     [0.375, 0.5, 0.950381679389313, 0.9087591240875912],
                                     [0.375, 0.625, 0.9631147540983607, 0.8901515151515151],
                                     [0.375, 0.75, 0.9691629955947136, 0.8461538461538461],
                                     [0.375, 0.875, 1.0, 0.6342592592592593], [0.375, 1.0, 0, 0],
                                     [0.5, 0.0, 0.6294536817102138, 0.9464285714285714],
                                     [0.5, 0.125, 0.8775510204081632, 0.9214285714285714],
                                     [0.5, 0.25, 0.8912280701754386, 0.927007299270073],
                                     [0.5, 0.375, 0.915129151291513, 0.9051094890510949],
                                     [0.5, 0.5, 0.9427480916030534, 0.9014598540145985],
                                     [0.5, 0.625, 0.9631147540983607, 0.8901515151515151],
                                     [0.5, 0.75, 0.9691629955947136, 0.8461538461538461],
                                     [0.5, 0.875, 1.0, 0.6342592592592593], [0.5, 1.0, 0, 0],
                                     [0.625, 0.0, 0.5961995249406176, 0.8964285714285715],
                                     [0.625, 0.125, 0.8401360544217688, 0.8821428571428571],
                                     [0.625, 0.25, 0.8631578947368421, 0.8978102189781022],
                                     [0.625, 0.375, 0.8892988929889298, 0.8795620437956204],
                                     [0.625, 0.5, 0.9198473282442748, 0.8795620437956204],
                                     [0.625, 0.625, 0.9549180327868853, 0.8825757575757576],
                                     [0.625, 0.75, 0.9647577092511013, 0.8423076923076923],
                                     [0.625, 0.875, 1.0, 0.6342592592592593], [0.625, 1.0, 0, 0],
                                     [0.75, 0.0, 0.501187648456057, 0.7535714285714286],
                                     [0.75, 0.125, 0.7142857142857143, 0.75],
                                     [0.75, 0.25, 0.7368421052631579, 0.7664233576642335],
                                     [0.75, 0.375, 0.7712177121771218, 0.7627737226277372],
                                     [0.75, 0.5, 0.7977099236641222, 0.7627737226277372],
                                     [0.75, 0.625, 0.8442622950819673, 0.7803030303030303],
                                     [0.75, 0.75, 0.8766519823788547, 0.7653846153846153],
                                     [0.75, 0.875, 0.9416058394160584, 0.5972222222222222], [0.75, 1.0, 0, 0],
                                     [0.875, 0.0, 0.24228028503562946, 0.36428571428571427],
                                     [0.875, 0.125, 0.3469387755102041, 0.36428571428571427],
                                     [0.875, 0.25, 0.35789473684210527, 0.3722627737226277],
                                     [0.875, 0.375, 0.3763837638376384, 0.3722627737226277],
                                     [0.875, 0.5, 0.3893129770992366, 0.3722627737226277],
                                     [0.875, 0.625, 0.4180327868852459, 0.38636363636363635],
                                     [0.875, 0.75, 0.44052863436123346, 0.38461538461538464],
                                     [0.875, 0.875, 0.5328467153284672, 0.33796296296296297], [0.875, 1.0, 0, 0],
                                     [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0],
                                     [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0],
                                     [1.0, 1.0, 0, 0]],
                        basketballcourt=[[0.0, 0.0, 0.6695652173913044, 1.0], [0.0, 0.125, 0.9506172839506173, 1.0],
                                         [0.0, 0.25, 0.9625, 1.0], [0.0, 0.375, 0.9746835443037974, 1.0],
                                         [0.0, 0.5, 0.9746835443037974, 1.0], [0.0, 0.625, 0.9746835443037974, 1.0],
                                         [0.0, 0.75, 0.9746835443037974, 1.0], [0.0, 0.875, 1.0, 0.8], [0.0, 1.0, 0, 0],
                                         [0.125, 0.0, 0.6695652173913044, 1.0], [0.125, 0.125, 0.9506172839506173, 1.0],
                                         [0.125, 0.25, 0.9625, 1.0], [0.125, 0.375, 0.9746835443037974, 1.0],
                                         [0.125, 0.5, 0.9746835443037974, 1.0], [0.125, 0.625, 0.9746835443037974, 1.0],
                                         [0.125, 0.75, 0.9746835443037974, 1.0], [0.125, 0.875, 1.0, 0.8],
                                         [0.125, 1.0, 0, 0], [0.25, 0.0, 0.6695652173913044, 1.0],
                                         [0.25, 0.125, 0.9506172839506173, 1.0], [0.25, 0.25, 0.9625, 1.0],
                                         [0.25, 0.375, 0.9746835443037974, 1.0], [0.25, 0.5, 0.9746835443037974, 1.0],
                                         [0.25, 0.625, 0.9746835443037974, 1.0], [0.25, 0.75, 0.9746835443037974, 1.0],
                                         [0.25, 0.875, 1.0, 0.8], [0.25, 1.0, 0, 0],
                                         [0.375, 0.0, 0.6695652173913044, 1.0], [0.375, 0.125, 0.9506172839506173, 1.0],
                                         [0.375, 0.25, 0.9625, 1.0], [0.375, 0.375, 0.9746835443037974, 1.0],
                                         [0.375, 0.5, 0.9746835443037974, 1.0], [0.375, 0.625, 0.9746835443037974, 1.0],
                                         [0.375, 0.75, 0.9746835443037974, 1.0], [0.375, 0.875, 1.0, 0.8],
                                         [0.375, 1.0, 0, 0], [0.5, 0.0, 0.6695652173913044, 1.0],
                                         [0.5, 0.125, 0.9506172839506173, 1.0], [0.5, 0.25, 0.9625, 1.0],
                                         [0.5, 0.375, 0.9746835443037974, 1.0], [0.5, 0.5, 0.9746835443037974, 1.0],
                                         [0.5, 0.625, 0.9746835443037974, 1.0], [0.5, 0.75, 0.9746835443037974, 1.0],
                                         [0.5, 0.875, 1.0, 0.8], [0.5, 1.0, 0, 0],
                                         [0.625, 0.0, 0.6608695652173913, 0.987012987012987],
                                         [0.625, 0.125, 0.9259259259259259, 0.974025974025974],
                                         [0.625, 0.25, 0.9375, 0.974025974025974],
                                         [0.625, 0.375, 0.9493670886075949, 0.974025974025974],
                                         [0.625, 0.5, 0.9493670886075949, 0.974025974025974],
                                         [0.625, 0.625, 0.9493670886075949, 0.974025974025974],
                                         [0.625, 0.75, 0.9493670886075949, 0.974025974025974], [0.625, 0.875, 1.0, 0.8],
                                         [0.625, 1.0, 0, 0], [0.75, 0.0, 0.6173913043478261, 0.922077922077922],
                                         [0.75, 0.125, 0.8641975308641975, 0.9090909090909091],
                                         [0.75, 0.25, 0.875, 0.9090909090909091],
                                         [0.75, 0.375, 0.8860759493670886, 0.9090909090909091],
                                         [0.75, 0.5, 0.8860759493670886, 0.9090909090909091],
                                         [0.75, 0.625, 0.8860759493670886, 0.9090909090909091],
                                         [0.75, 0.75, 0.8860759493670886, 0.9090909090909091],
                                         [0.75, 0.875, 0.9444444444444444, 0.7555555555555555], [0.75, 1.0, 0, 0],
                                         [0.875, 0.0, 0.21739130434782608, 0.3246753246753247],
                                         [0.875, 0.125, 0.30864197530864196, 0.3246753246753247],
                                         [0.875, 0.25, 0.3125, 0.3246753246753247],
                                         [0.875, 0.375, 0.31645569620253167, 0.3246753246753247],
                                         [0.875, 0.5, 0.31645569620253167, 0.3246753246753247],
                                         [0.875, 0.625, 0.31645569620253167, 0.3246753246753247],
                                         [0.875, 0.75, 0.31645569620253167, 0.3246753246753247],
                                         [0.875, 0.875, 0.4166666666666667, 0.3333333333333333], [0.875, 1.0, 0, 0],
                                         [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0],
                                         [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0],
                                         [1.0, 1.0, 0, 0]],
                        groundtrackfield=[[0.0, 0.0, 0.9072164948453608, 1.0], [0.0, 0.125, 1.0, 1.0],
                                          [0.0, 0.25, 1.0, 1.0], [0.0, 0.375, 1.0, 1.0], [0.0, 0.5, 1.0, 1.0],
                                          [0.0, 0.625, 1.0, 1.0], [0.0, 0.75, 1.0, 1.0], [0.0, 0.875, 1.0, 1.0],
                                          [0.0, 1.0, 0, 0], [0.125, 0.0, 0.9072164948453608, 1.0],
                                          [0.125, 0.125, 1.0, 1.0], [0.125, 0.25, 1.0, 1.0], [0.125, 0.375, 1.0, 1.0],
                                          [0.125, 0.5, 1.0, 1.0], [0.125, 0.625, 1.0, 1.0], [0.125, 0.75, 1.0, 1.0],
                                          [0.125, 0.875, 1.0, 1.0], [0.125, 1.0, 0, 0],
                                          [0.25, 0.0, 0.9072164948453608, 1.0], [0.25, 0.125, 1.0, 1.0],
                                          [0.25, 0.25, 1.0, 1.0], [0.25, 0.375, 1.0, 1.0], [0.25, 0.5, 1.0, 1.0],
                                          [0.25, 0.625, 1.0, 1.0], [0.25, 0.75, 1.0, 1.0], [0.25, 0.875, 1.0, 1.0],
                                          [0.25, 1.0, 0, 0], [0.375, 0.0, 0.9072164948453608, 1.0],
                                          [0.375, 0.125, 1.0, 1.0], [0.375, 0.25, 1.0, 1.0], [0.375, 0.375, 1.0, 1.0],
                                          [0.375, 0.5, 1.0, 1.0], [0.375, 0.625, 1.0, 1.0], [0.375, 0.75, 1.0, 1.0],
                                          [0.375, 0.875, 1.0, 1.0], [0.375, 1.0, 0, 0],
                                          [0.5, 0.0, 0.9072164948453608, 1.0], [0.5, 0.125, 1.0, 1.0],
                                          [0.5, 0.25, 1.0, 1.0], [0.5, 0.375, 1.0, 1.0], [0.5, 0.5, 1.0, 1.0],
                                          [0.5, 0.625, 1.0, 1.0], [0.5, 0.75, 1.0, 1.0], [0.5, 0.875, 1.0, 1.0],
                                          [0.5, 1.0, 0, 0], [0.625, 0.0, 0.9072164948453608, 1.0],
                                          [0.625, 0.125, 1.0, 1.0], [0.625, 0.25, 1.0, 1.0], [0.625, 0.375, 1.0, 1.0],
                                          [0.625, 0.5, 1.0, 1.0], [0.625, 0.625, 1.0, 1.0], [0.625, 0.75, 1.0, 1.0],
                                          [0.625, 0.875, 1.0, 1.0], [0.625, 1.0, 0, 0],
                                          [0.75, 0.0, 0.9072164948453608, 1.0], [0.75, 0.125, 1.0, 1.0],
                                          [0.75, 0.25, 1.0, 1.0], [0.75, 0.375, 1.0, 1.0], [0.75, 0.5, 1.0, 1.0],
                                          [0.75, 0.625, 1.0, 1.0], [0.75, 0.75, 1.0, 1.0], [0.75, 0.875, 1.0, 1.0],
                                          [0.75, 1.0, 0, 0], [0.875, 0.0, 0.7422680412371134, 0.8181818181818182],
                                          [0.875, 0.125, 0.8181818181818182, 0.8181818181818182],
                                          [0.875, 0.25, 0.8181818181818182, 0.8181818181818182],
                                          [0.875, 0.375, 0.8181818181818182, 0.8181818181818182],
                                          [0.875, 0.5, 0.8181818181818182, 0.8181818181818182],
                                          [0.875, 0.625, 0.8275862068965517, 0.8275862068965517],
                                          [0.875, 0.75, 0.8255813953488372, 0.8255813953488372],
                                          [0.875, 0.875, 0.8214285714285714, 0.8214285714285714], [0.875, 1.0, 0, 0],
                                          [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0],
                                          [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0],
                                          [1.0, 1.0, 0, 0]],
                        harbor=[[0.0, 0.0, 0.42777777777777776, 1.0], [0.0, 0.125, 0.9390243902439024, 1.0],
                                [0.0, 0.25, 0.9746835443037974, 1.0], [0.0, 0.375, 0.9871794871794872, 1.0],
                                [0.0, 0.5, 0.987012987012987, 0.987012987012987],
                                [0.0, 0.625, 0.9868421052631579, 0.974025974025974],
                                [0.0, 0.75, 0.9857142857142858, 0.8961038961038961],
                                [0.0, 0.875, 1.0, 0.3220338983050847], [0.0, 1.0, 0, 0],
                                [0.125, 0.0, 0.42777777777777776, 1.0], [0.125, 0.125, 0.9390243902439024, 1.0],
                                [0.125, 0.25, 0.9746835443037974, 1.0], [0.125, 0.375, 0.9871794871794872, 1.0],
                                [0.125, 0.5, 0.987012987012987, 0.987012987012987],
                                [0.125, 0.625, 0.9868421052631579, 0.974025974025974],
                                [0.125, 0.75, 0.9857142857142858, 0.8961038961038961],
                                [0.125, 0.875, 1.0, 0.3220338983050847], [0.125, 1.0, 0, 0],
                                [0.25, 0.0, 0.42777777777777776, 1.0], [0.25, 0.125, 0.9390243902439024, 1.0],
                                [0.25, 0.25, 0.9746835443037974, 1.0], [0.25, 0.375, 0.9871794871794872, 1.0],
                                [0.25, 0.5, 0.987012987012987, 0.987012987012987],
                                [0.25, 0.625, 0.9868421052631579, 0.974025974025974],
                                [0.25, 0.75, 0.9857142857142858, 0.8961038961038961],
                                [0.25, 0.875, 1.0, 0.3220338983050847], [0.25, 1.0, 0, 0],
                                [0.375, 0.0, 0.42777777777777776, 1.0], [0.375, 0.125, 0.9390243902439024, 1.0],
                                [0.375, 0.25, 0.9746835443037974, 1.0], [0.375, 0.375, 0.9871794871794872, 1.0],
                                [0.375, 0.5, 0.987012987012987, 0.987012987012987],
                                [0.375, 0.625, 0.9868421052631579, 0.974025974025974],
                                [0.375, 0.75, 0.9857142857142858, 0.8961038961038961],
                                [0.375, 0.875, 1.0, 0.3220338983050847], [0.375, 1.0, 0, 0],
                                [0.5, 0.0, 0.42777777777777776, 1.0], [0.5, 0.125, 0.9390243902439024, 1.0],
                                [0.5, 0.25, 0.9746835443037974, 1.0], [0.5, 0.375, 0.9871794871794872, 1.0],
                                [0.5, 0.5, 0.987012987012987, 0.987012987012987],
                                [0.5, 0.625, 0.9868421052631579, 0.974025974025974],
                                [0.5, 0.75, 0.9857142857142858, 0.8961038961038961],
                                [0.5, 0.875, 1.0, 0.3220338983050847], [0.5, 1.0, 0, 0],
                                [0.625, 0.0, 0.4166666666666667, 0.974025974025974],
                                [0.625, 0.125, 0.9146341463414634, 0.974025974025974],
                                [0.625, 0.25, 0.9493670886075949, 0.974025974025974],
                                [0.625, 0.375, 0.9615384615384616, 0.974025974025974],
                                [0.625, 0.5, 0.961038961038961, 0.961038961038961],
                                [0.625, 0.625, 0.9605263157894737, 0.948051948051948],
                                [0.625, 0.75, 0.9857142857142858, 0.8961038961038961],
                                [0.625, 0.875, 1.0, 0.3220338983050847], [0.625, 1.0, 0, 0],
                                [0.75, 0.0, 0.39444444444444443, 0.922077922077922],
                                [0.75, 0.125, 0.8658536585365854, 0.922077922077922],
                                [0.75, 0.25, 0.8987341772151899, 0.922077922077922],
                                [0.75, 0.375, 0.9102564102564102, 0.922077922077922],
                                [0.75, 0.5, 0.9090909090909091, 0.9090909090909091],
                                [0.75, 0.625, 0.9210526315789473, 0.9090909090909091],
                                [0.75, 0.75, 0.9714285714285714, 0.8831168831168831],
                                [0.75, 0.875, 1.0, 0.3220338983050847], [0.75, 1.0, 0, 0],
                                [0.875, 0.0, 0.16111111111111112, 0.37662337662337664],
                                [0.875, 0.125, 0.35365853658536583, 0.37662337662337664],
                                [0.875, 0.25, 0.3670886075949367, 0.37662337662337664],
                                [0.875, 0.375, 0.3717948717948718, 0.37662337662337664],
                                [0.875, 0.5, 0.37662337662337664, 0.37662337662337664],
                                [0.875, 0.625, 0.3815789473684211, 0.37662337662337664],
                                [0.875, 0.75, 0.4, 0.36363636363636365],
                                [0.875, 0.875, 0.2631578947368421, 0.0847457627118644], [0.875, 1.0, 0, 0],
                                [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0],
                                [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0],
                                [1.0, 1.0, 0, 0]],
                        bridge=[[0.0, 0.0, 0.5048543689320388, 1.0], [0.0, 0.125, 0.8771929824561403, 1.0],
                                [0.0, 0.25, 0.8928571428571429, 1.0], [0.0, 0.375, 0.9259259259259259, 1.0],
                                [0.0, 0.5, 0.9433962264150944, 1.0], [0.0, 0.625, 0.9607843137254902, 0.98],
                                [0.0, 0.75, 0.9607843137254902, 0.98], [0.0, 0.875, 1.0, 0.8444444444444444],
                                [0.0, 1.0, 0, 0], [0.125, 0.0, 0.5048543689320388, 1.0],
                                [0.125, 0.125, 0.8596491228070176, 0.98], [0.125, 0.25, 0.875, 0.98],
                                [0.125, 0.375, 0.9074074074074074, 0.98], [0.125, 0.5, 0.9245283018867925, 0.98],
                                [0.125, 0.625, 0.9411764705882353, 0.96], [0.125, 0.75, 0.9411764705882353, 0.96],
                                [0.125, 0.875, 0.9736842105263158, 0.8222222222222222], [0.125, 1.0, 0, 0],
                                [0.25, 0.0, 0.5048543689320388, 1.0], [0.25, 0.125, 0.8596491228070176, 0.98],
                                [0.25, 0.25, 0.875, 0.98], [0.25, 0.375, 0.9074074074074074, 0.98],
                                [0.25, 0.5, 0.9245283018867925, 0.98], [0.25, 0.625, 0.9411764705882353, 0.96],
                                [0.25, 0.75, 0.9411764705882353, 0.96],
                                [0.25, 0.875, 0.9736842105263158, 0.8222222222222222], [0.25, 1.0, 0, 0],
                                [0.375, 0.0, 0.5048543689320388, 1.0], [0.375, 0.125, 0.8596491228070176, 0.98],
                                [0.375, 0.25, 0.875, 0.98], [0.375, 0.375, 0.9074074074074074, 0.98],
                                [0.375, 0.5, 0.9245283018867925, 0.98], [0.375, 0.625, 0.9411764705882353, 0.96],
                                [0.375, 0.75, 0.9411764705882353, 0.96],
                                [0.375, 0.875, 0.9736842105263158, 0.8222222222222222], [0.375, 1.0, 0, 0],
                                [0.5, 0.0, 0.49514563106796117, 0.9807692307692307],
                                [0.5, 0.125, 0.8596491228070176, 0.98], [0.5, 0.25, 0.875, 0.98],
                                [0.5, 0.375, 0.9074074074074074, 0.98], [0.5, 0.5, 0.9245283018867925, 0.98],
                                [0.5, 0.625, 0.9411764705882353, 0.96], [0.5, 0.75, 0.9411764705882353, 0.96],
                                [0.5, 0.875, 0.9736842105263158, 0.8222222222222222], [0.5, 1.0, 0, 0],
                                [0.625, 0.0, 0.4563106796116505, 0.9038461538461539],
                                [0.625, 0.125, 0.7894736842105263, 0.9], [0.625, 0.25, 0.8035714285714286, 0.9],
                                [0.625, 0.375, 0.8333333333333334, 0.9], [0.625, 0.5, 0.8490566037735849, 0.9],
                                [0.625, 0.625, 0.8823529411764706, 0.9], [0.625, 0.75, 0.8823529411764706, 0.9],
                                [0.625, 0.875, 0.9210526315789473, 0.7777777777777778], [0.625, 1.0, 0, 0],
                                [0.75, 0.0, 0.3592233009708738, 0.7115384615384616],
                                [0.75, 0.125, 0.6491228070175439, 0.74], [0.75, 0.25, 0.6607142857142857, 0.74],
                                [0.75, 0.375, 0.6851851851851852, 0.74], [0.75, 0.5, 0.6981132075471698, 0.74],
                                [0.75, 0.625, 0.7254901960784313, 0.74], [0.75, 0.75, 0.7254901960784313, 0.74],
                                [0.75, 0.875, 0.8157894736842105, 0.6888888888888889], [0.75, 1.0, 0, 0],
                                [0.875, 0.0, 0.17475728155339806, 0.34615384615384615],
                                [0.875, 0.125, 0.3157894736842105, 0.36], [0.875, 0.25, 0.32142857142857145, 0.36],
                                [0.875, 0.375, 0.3333333333333333, 0.36], [0.875, 0.5, 0.33962264150943394, 0.36],
                                [0.875, 0.625, 0.35294117647058826, 0.36], [0.875, 0.75, 0.35294117647058826, 0.36],
                                [0.875, 0.875, 0.47368421052631576, 0.4], [0.875, 1.0, 0, 0], [1.0, 0.0, 0, 0],
                                [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0], [1.0, 0.5, 0, 0],
                                [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0], [1.0, 1.0, 0, 0]],
                        vehicle=[[0.0, 0.0, 0.47346938775510206, 0.9830508474576272],
                                 [0.0, 0.125, 0.8740359897172236, 0.8673469387755102],
                                 [0.0, 0.25, 0.9072753209700428, 0.8292046936114733],
                                 [0.0, 0.375, 0.9204368174726989, 0.787716955941255],
                                 [0.0, 0.5, 0.9432624113475178, 0.7337931034482759],
                                 [0.0, 0.625, 0.9600840336134454, 0.6740412979351033],
                                 [0.0, 0.75, 0.9809885931558935, 0.5170340681362725], [0.0, 0.875, 1.0, 0.375],
                                 [0.0, 1.0, 0, 0], [0.125, 0.0, 0.42857142857142855, 0.8898305084745762],
                                 [0.125, 0.125, 0.8020565552699229, 0.7959183673469388],
                                 [0.125, 0.25, 0.8416547788873039, 0.7692307692307693],
                                 [0.125, 0.375, 0.858034321372855, 0.7343124165554072],
                                 [0.125, 0.5, 0.8882978723404256, 0.6910344827586207],
                                 [0.125, 0.625, 0.9054621848739496, 0.6356932153392331],
                                 [0.125, 0.75, 0.9505703422053232, 0.501002004008016], [0.125, 0.875, 1.0, 0.375],
                                 [0.125, 1.0, 0, 0], [0.25, 0.0, 0.4186588921282799, 0.8692493946731235],
                                 [0.25, 0.125, 0.7917737789203085, 0.7857142857142857],
                                 [0.25, 0.25, 0.833095577746077, 0.7614080834419817],
                                 [0.25, 0.375, 0.8549141965678627, 0.7316421895861148],
                                 [0.25, 0.5, 0.8865248226950354, 0.6896551724137931],
                                 [0.25, 0.625, 0.9054621848739496, 0.6356932153392331],
                                 [0.25, 0.75, 0.9505703422053232, 0.501002004008016], [0.25, 0.875, 1.0, 0.375],
                                 [0.25, 1.0, 0, 0], [0.375, 0.0, 0.39941690962099125, 0.8292978208232445],
                                 [0.375, 0.125, 0.7750642673521851, 0.7691326530612245],
                                 [0.375, 0.25, 0.8174037089871612, 0.7470664928292047],
                                 [0.375, 0.375, 0.84399375975039, 0.7222963951935915],
                                 [0.375, 0.5, 0.8812056737588653, 0.6855172413793104],
                                 [0.375, 0.625, 0.9012605042016807, 0.6327433628318584],
                                 [0.375, 0.75, 0.9505703422053232, 0.501002004008016], [0.375, 0.875, 1.0, 0.375],
                                 [0.375, 1.0, 0, 0], [0.5, 0.0, 0.3685131195335277, 0.7651331719128329],
                                 [0.5, 0.125, 0.7326478149100257, 0.7270408163265306],
                                 [0.5, 0.25, 0.7817403708987162, 0.7144719687092569],
                                 [0.5, 0.375, 0.8127925117004681, 0.6955941255006676],
                                 [0.5, 0.5, 0.8563829787234043, 0.6662068965517242],
                                 [0.5, 0.625, 0.8928571428571429, 0.6268436578171092],
                                 [0.5, 0.75, 0.9429657794676806, 0.4969939879759519], [0.5, 0.875, 1.0, 0.375],
                                 [0.5, 1.0, 0, 0], [0.625, 0.0, 0.30495626822157434, 0.6331719128329297],
                                 [0.625, 0.125, 0.6246786632390745, 0.6198979591836735],
                                 [0.625, 0.25, 0.6690442225392297, 0.6114732724902217],
                                 [0.625, 0.375, 0.7035881435257411, 0.6021361815754339],
                                 [0.625, 0.5, 0.7553191489361702, 0.5875862068965517],
                                 [0.625, 0.625, 0.8067226890756303, 0.5663716814159292],
                                 [0.625, 0.75, 0.8973384030418251, 0.4729458917835671], [0.625, 0.875, 1.0, 0.375],
                                 [0.625, 1.0, 0, 0], [0.75, 0.0, 0.18134110787172011, 0.3765133171912833],
                                 [0.75, 0.125, 0.38431876606683807, 0.38137755102040816],
                                 [0.75, 0.25, 0.41512125534950073, 0.379400260756193],
                                 [0.75, 0.375, 0.43993759750390016, 0.376502002670227],
                                 [0.75, 0.5, 0.4804964539007092, 0.3737931034482759],
                                 [0.75, 0.625, 0.5273109243697479, 0.3702064896755162],
                                 [0.75, 0.75, 0.6996197718631179, 0.3687374749498998], [0.75, 0.875, 1.0, 0.375],
                                 [0.75, 1.0, 0, 0], [0.875, 0.0, 0.03965014577259475, 0.08232445520581114],
                                 [0.875, 0.125, 0.08483290488431877, 0.08418367346938775],
                                 [0.875, 0.25, 0.09415121255349501, 0.08604954367666232],
                                 [0.875, 0.375, 0.0998439937597504, 0.08544726301735647],
                                 [0.875, 0.5, 0.11347517730496454, 0.08827586206896551],
                                 [0.875, 0.625, 0.13025210084033614, 0.09144542772861357],
                                 [0.875, 0.75, 0.19391634980988592, 0.10220440881763528],
                                 [0.875, 0.875, 0.3333333333333333, 0.125], [0.875, 1.0, 0, 0], [1.0, 0.0, 0, 0],
                                 [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0], [1.0, 0.5, 0, 0],
                                 [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0], [1.0, 1.0, 0, 0]],
                        van=[[0.0, 0.0, 0.29157175398633256, 0.9922480620155039],
                             [0.0, 0.125, 0.7163120567375887, 0.8782608695652174],
                             [0.0, 0.25, 0.8090909090909091, 0.8317757009345794],
                             [0.0, 0.375, 0.8241758241758241, 0.7731958762886598],
                             [0.0, 0.5, 0.8985507246376812, 0.775],
                             [0.0, 0.625, 0.9767441860465116, 0.7777777777777778], [0.0, 0.75, 1.0, 0.7],
                             [0.0, 0.875, 0, 0], [0.0, 1.0, 0, 0],
                             [0.125, 0.0, 0.24145785876993167, 0.8217054263565892],
                             [0.125, 0.125, 0.5957446808510638, 0.7304347826086957],
                             [0.125, 0.25, 0.7, 0.719626168224299],
                             [0.125, 0.375, 0.7362637362637363, 0.6907216494845361],
                             [0.125, 0.5, 0.855072463768116, 0.7375],
                             [0.125, 0.625, 0.9302325581395349, 0.7407407407407407], [0.125, 0.75, 1.0, 0.7],
                             [0.125, 0.875, 0, 0], [0.125, 1.0, 0, 0],
                             [0.25, 0.0, 0.23917995444191345, 0.813953488372093],
                             [0.25, 0.125, 0.5957446808510638, 0.7304347826086957],
                             [0.25, 0.25, 0.7, 0.719626168224299],
                             [0.25, 0.375, 0.7362637362637363, 0.6907216494845361],
                             [0.25, 0.5, 0.855072463768116, 0.7375],
                             [0.25, 0.625, 0.9302325581395349, 0.7407407407407407], [0.25, 0.75, 1.0, 0.7],
                             [0.25, 0.875, 0, 0], [0.25, 1.0, 0, 0],
                             [0.375, 0.0, 0.23462414578587698, 0.7984496124031008],
                             [0.375, 0.125, 0.5957446808510638, 0.7304347826086957],
                             [0.375, 0.25, 0.7, 0.719626168224299],
                             [0.375, 0.375, 0.7362637362637363, 0.6907216494845361],
                             [0.375, 0.5, 0.855072463768116, 0.7375],
                             [0.375, 0.625, 0.9302325581395349, 0.7407407407407407], [0.375, 0.75, 1.0, 0.7],
                             [0.375, 0.875, 0, 0], [0.375, 1.0, 0, 0],
                             [0.5, 0.0, 0.214123006833713, 0.7286821705426356],
                             [0.5, 0.125, 0.574468085106383, 0.7043478260869566],
                             [0.5, 0.25, 0.6727272727272727, 0.6915887850467289],
                             [0.5, 0.375, 0.7142857142857143, 0.6701030927835051],
                             [0.5, 0.5, 0.855072463768116, 0.7375],
                             [0.5, 0.625, 0.9302325581395349, 0.7407407407407407], [0.5, 0.75, 1.0, 0.7],
                             [0.5, 0.875, 0, 0], [0.5, 1.0, 0, 0],
                             [0.625, 0.0, 0.17995444191343962, 0.6124031007751938],
                             [0.625, 0.125, 0.48936170212765956, 0.6],
                             [0.625, 0.25, 0.5727272727272728, 0.5887850467289719],
                             [0.625, 0.375, 0.6373626373626373, 0.5979381443298969],
                             [0.625, 0.5, 0.782608695652174, 0.675],
                             [0.625, 0.625, 0.8372093023255814, 0.6666666666666666], [0.625, 0.75, 1.0, 0.7],
                             [0.625, 0.875, 0, 0], [0.625, 1.0, 0, 0],
                             [0.75, 0.0, 0.08428246013667426, 0.2868217054263566],
                             [0.75, 0.125, 0.2198581560283688, 0.26956521739130435],
                             [0.75, 0.25, 0.2727272727272727, 0.2803738317757009],
                             [0.75, 0.375, 0.2967032967032967, 0.27835051546391754],
                             [0.75, 0.5, 0.36231884057971014, 0.3125],
                             [0.75, 0.625, 0.3488372093023256, 0.2777777777777778],
                             [0.75, 0.75, 0.5714285714285714, 0.4], [0.75, 0.875, 0, 0], [0.75, 1.0, 0, 0],
                             [0.875, 0.0, 0.011389521640091117, 0.03875968992248062],
                             [0.875, 0.125, 0.028368794326241134, 0.034782608695652174],
                             [0.875, 0.25, 0.03636363636363636, 0.037383177570093455],
                             [0.875, 0.375, 0.02197802197802198, 0.020618556701030927],
                             [0.875, 0.5, 0.028985507246376812, 0.025],
                             [0.875, 0.625, 0.046511627906976744, 0.037037037037037035], [0.875, 0.75, 0, 0],
                             [0.875, 0.875, 0, 0], [0.875, 1.0, 0, 0], [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0],
                             [1.0, 0.25, 0, 0], [1.0, 0.375, 0, 0], [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0],
                             [1.0, 0.75, 0, 0], [1.0, 0.875, 0, 0], [1.0, 1.0, 0, 0]],
                        truck=[[0.0, 0.0, 0.38110403397027603, 0.967654986522911],
                               [0.0, 0.125, 0.8339350180505415, 0.8020833333333334],
                               [0.0, 0.25, 0.9033816425120773, 0.7056603773584905],
                               [0.0, 0.375, 0.9411764705882353, 0.6477732793522267],
                               [0.0, 0.5, 0.9586776859504132, 0.5948717948717949],
                               [0.0, 0.625, 0.9651162790697675, 0.5804195804195804],
                               [0.0, 0.75, 0.9655172413793104, 0.6222222222222222], [0.0, 0.875, 0, 0],
                               [0.0, 1.0, 0, 0], [0.125, 0.0, 0.2791932059447983, 0.7088948787061995],
                               [0.125, 0.125, 0.6353790613718412, 0.6111111111111112],
                               [0.125, 0.25, 0.7101449275362319, 0.5547169811320755],
                               [0.125, 0.375, 0.7705882352941177, 0.5303643724696356],
                               [0.125, 0.5, 0.8347107438016529, 0.517948717948718],
                               [0.125, 0.625, 0.8604651162790697, 0.5174825174825175],
                               [0.125, 0.75, 0.7931034482758621, 0.5111111111111111], [0.125, 0.875, 0, 0],
                               [0.125, 1.0, 0, 0], [0.25, 0.0, 0.267515923566879, 0.6792452830188679],
                               [0.25, 0.125, 0.6173285198555957, 0.59375],
                               [0.25, 0.25, 0.6859903381642513, 0.5358490566037736],
                               [0.25, 0.375, 0.7529411764705882, 0.5182186234817814],
                               [0.25, 0.5, 0.8181818181818182, 0.5076923076923077],
                               [0.25, 0.625, 0.8604651162790697, 0.5174825174825175],
                               [0.25, 0.75, 0.7931034482758621, 0.5111111111111111], [0.25, 0.875, 0, 0],
                               [0.25, 1.0, 0, 0], [0.375, 0.0, 0.25477707006369427, 0.6469002695417789],
                               [0.375, 0.125, 0.5992779783393501, 0.5763888888888888],
                               [0.375, 0.25, 0.6763285024154589, 0.5283018867924528],
                               [0.375, 0.375, 0.7470588235294118, 0.5141700404858299],
                               [0.375, 0.5, 0.8181818181818182, 0.5076923076923077],
                               [0.375, 0.625, 0.8604651162790697, 0.5174825174825175],
                               [0.375, 0.75, 0.7931034482758621, 0.5111111111111111], [0.375, 0.875, 0, 0],
                               [0.375, 1.0, 0, 0], [0.5, 0.0, 0.23779193205944799, 0.6037735849056604],
                               [0.5, 0.125, 0.5667870036101083, 0.5451388888888888],
                               [0.5, 0.25, 0.6521739130434783, 0.5094339622641509],
                               [0.5, 0.375, 0.7235294117647059, 0.4979757085020243],
                               [0.5, 0.5, 0.7851239669421488, 0.48717948717948717],
                               [0.5, 0.625, 0.8255813953488372, 0.4965034965034965],
                               [0.5, 0.75, 0.7931034482758621, 0.5111111111111111], [0.5, 0.875, 0, 0],
                               [0.5, 1.0, 0, 0], [0.625, 0.0, 0.18683651804670912, 0.4743935309973046],
                               [0.625, 0.125, 0.4584837545126354, 0.4409722222222222],
                               [0.625, 0.25, 0.5314009661835749, 0.41509433962264153],
                               [0.625, 0.375, 0.6, 0.41295546558704455],
                               [0.625, 0.5, 0.6528925619834711, 0.40512820512820513],
                               [0.625, 0.625, 0.7441860465116279, 0.44755244755244755],
                               [0.625, 0.75, 0.7586206896551724, 0.4888888888888889], [0.625, 0.875, 0, 0],
                               [0.625, 1.0, 0, 0], [0.75, 0.0, 0.08067940552016985, 0.20485175202156333],
                               [0.75, 0.125, 0.20938628158844766, 0.2013888888888889],
                               [0.75, 0.25, 0.2560386473429952, 0.2],
                               [0.75, 0.375, 0.2823529411764706, 0.19433198380566802],
                               [0.75, 0.5, 0.30578512396694213, 0.18974358974358974],
                               [0.75, 0.625, 0.38372093023255816, 0.23076923076923078],
                               [0.75, 0.75, 0.41379310344827586, 0.26666666666666666], [0.75, 0.875, 0, 0],
                               [0.75, 1.0, 0, 0], [0.875, 0.0, 0.010615711252653927, 0.026954177897574125],
                               [0.875, 0.125, 0.02888086642599278, 0.027777777777777776],
                               [0.875, 0.25, 0.033816425120772944, 0.026415094339622643],
                               [0.875, 0.375, 0.041176470588235294, 0.02834008097165992],
                               [0.875, 0.5, 0.04132231404958678, 0.02564102564102564],
                               [0.875, 0.625, 0.05813953488372093, 0.03496503496503497],
                               [0.875, 0.75, 0.10344827586206896, 0.06666666666666667], [0.875, 0.875, 0, 0],
                               [0.875, 1.0, 0, 0], [1.0, 0.0, 0, 0], [1.0, 0.125, 0, 0], [1.0, 0.25, 0, 0],
                               [1.0, 0.375, 0, 0], [1.0, 0.5, 0, 0], [1.0, 0.625, 0, 0], [1.0, 0.75, 0, 0],
                               [1.0, 0.875, 0, 0], [1.0, 1.0, 0, 0]])


# [iou, prob, precision, recall]
iou_limit, prob_limit = 0.45, 0.75
for sign_name, sign_detail in res_details_dict.items():
    print(sign_name)
    for item in sign_detail:
        if item[0] == iou_limit and item[1] == prob_limit:
            print(item)


idx_sign_dict = {
    1: "airplane",
    2: "ship",
    3: "storagetank",
    4: "baseballdiamond",
    5: "tenniscourt",
    6: "basketballcourt",
    7: "groundtrackfield",
    8: "harbor",
    9: "bridge",
    10: "vehicle",
    11: "van",
    12: "truck"
}

for _, sign_name in idx_sign_dict.items():
    fig = plt.figure(figsize=(8, 6))
    ax = Axes3D(fig)
    sub_sign_info = res_details_dict[sign_name]
    sign_np = np.array(sub_sign_info)
    precision_np = sign_np[:, 2]
    # IOU
    X = np.linspace(0, 1, 9)
    # PROB
    Y = np.linspace(0, 1, 9)
    X, Y = np.meshgrid(X, Y)
    Z = precision_np.reshape((9, 9)).T
    # print(Z)

    surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap='coolwarm',
                    linewidth=1, antialiased=True)
    fig.colorbar(surf, shrink=0.5, aspect=5)
    ax.set_xlabel("IOU")
    ax.set_ylabel("PROB")
    ax.set_zlabel("Recall")
    plt.savefig(sign_name+"_percision.png", format='png')
    # plt.show()

# import pandas as pd
# import csv
# 
# with open("ssd.run.log", "r") as log_reader:
#     cur_idx = 0
#     res_list = list()
#     for line in log_reader:
#         cur_idx += 1
#         info = line.strip().split("]")[-1].strip()
#         if cur_idx % 3 == 1:
#             res_list.append(list())
#             iteration, loss_info = info.split(",")
#             iter_cnt = iteration.split(" ")[-1].strip()
#             loss_val = loss_info.split("=")[-1].strip()
#             res_list[-1].append(iter_cnt)
#             res_list[-1].append(loss_val)
#         if cur_idx % 3 == 2:
#             mbox_loss = info.split(":")[-1].strip().split("(")[0].strip().split(
#                 "=")[-1].strip()
#             res_list[-1].append(mbox_loss)
#         if cur_idx % 3 == 0:
#             lr_val = info.split(",")[-1].strip().split("=")[-1].strip()
#             res_list[-1].append(lr_val)
#     # print(res_list)

# sub_res_list = []
# for i in range(len(res_list)):
#     if i % 50 == 0:
#         sub_res_list.append(res_list[i])
#         print("{},{},{}".format(
#             res_list[i][0], res_list[i][1], res_list[i][2], res_list[i][3]))
# 
# with open("a.csv", "w") as h:
#     writer = csv.writer(h)
#     writer.writerows(sub_res_list)
# 
# pd_info = pd.DataFrame(
#     data=sub_res_list, columns=["iter", "loss", "mbox_loss"])
# pd_info_iter = pd_info.set_index("iter")
# pd_info_iter = pd_info_iter.apply(pd.to_numeric)
# pd_info_iter.plot()
# plt.show()

# import os
# import argparse
# 
# def dealwith_image_list(src_path, out_path, frame_nums=16):
#     if not os.path.exists(src_path):
#         raise IOError("Not %s path" % src_path)
#     res_list = list()
#     with open(src_path, "r") as reader:
#         for line in reader:
#             line = line.strip()
#             image_dir, image_label = line.split()
#             img_nums = len(os.listdir(image_dir))
#             for idx in range(1, img_nums, frame_nums):
#                 if idx + frame_nums > img_nums:
#                     idx = img_nums - frame_nums
#                 res_list.append([image_dir, idx, image_label])
#     with open(out_path, "w") as writer:
#         for item in res_list:
#             writer.write("{} {} {}\n".format(item[0], item[1], item[2]))
# 
# if __name__ == '__main__':
#     parser = argparse.ArgumentParser()
#     parser.add_argument("-i", "--input", help="input source path")
#     parser.add_argument("-o", "--output", help="output path")
#     parser.add_argument("-f", "--fps", default=16, help="frame number in each group")
#     args = parser.parse_args()
#     src_path = args.input
#     out_path = args.output
#     frame_nums = args.fps
#     dealwith_image_list(src_path, out_path, frame_nums)